import api from '../../api/index.js'
// import config from '../../common/config.js'
const follow = {
	state: {
		eleList: ''
	},
	mutations: {
		eleList(state, opt) {
			state.eleList = opt
		}
		
	},
	actions: {
		// 获取我的关注列表
		get_EleList({commit, state}, opt) {
			api.getEleList(opt)
			.then(res => {
				if(res.data.code == '200') {
					commit('eleList', res.data.data)
				}
			})
		},
		//添加/取消关注
		attention({commit, state}, opt) {
			if(opt.type == 1) {
				return api.add_Attention(opt)
			}else{
				return api.cancel_Attention(opt)
			}
		}
		
	}
}

export default follow